package bank.passbook.vo;

import java.io.Serializable;
import java.util.Calendar;

public class Passbook implements Serializable{
	private String accountNumber;  
	private String owner;
	private int money;
	private String createDate;
	private double interest;
	
	public Passbook() {	}

	public Passbook(String accountNumber, String owner, int money,
			String createDate, double interest) {
		this.accountNumber = accountNumber;
		this.owner = owner;
		this.money = money;
		this.createDate = createDate;
		this.interest = interest;
	}

	public String getAccountNumber() {
		return accountNumber;
	}

	public void setAccountNumber(String accountNumber) {
		this.accountNumber = accountNumber;
	}

	public String getOwner() {
		return owner;
	}

	public void setOwner(String owner) {
		this.owner = owner;
	}

	public int getMoney() {
		return money;
	}

	public void setMoney(int money) {
		this.money = money;
	}

	public String getCreateDate() {
		return createDate;
	}

	public void setCreateDate(String createDate) {
		this.createDate = createDate;
	}

	public double getInterest() {
		return interest;
	}

	public void setInterest(double interest) {
		this.interest = interest;
	}

	@Override
	public String toString() {
		return "Passbook [accountNumber=" + accountNumber + ", owner=" + owner
				+ ", money=" + money + ", createDate=" + createDate
				+ ", interest=" + interest + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((accountNumber == null) ? 0 : accountNumber.hashCode());
		result = prime * result
				+ ((createDate == null) ? 0 : createDate.hashCode());
		long temp;
		temp = Double.doubleToLongBits(interest);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + money;
		result = prime * result + ((owner == null) ? 0 : owner.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Passbook other = (Passbook) obj;
		if (accountNumber == null) {
			if (other.accountNumber != null)
				return false;
		} else if (!accountNumber.equals(other.accountNumber))
			return false;
		if (createDate == null) {
			if (other.createDate != null)
				return false;
		} else if (!createDate.equals(other.createDate))
			return false;
		if (Double.doubleToLongBits(interest) != Double
				.doubleToLongBits(other.interest))
			return false;
		if (money != other.money)
			return false;
		if (owner == null) {
			if (other.owner != null)
				return false;
		} else if (!owner.equals(other.owner))
			return false;
		return true;
	}
}
